package com.example.controller;


import com.example.domain.Book;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/books")
public class BookController {

    @GetMapping
    public String getByID(){
        System.out.print("getById running...");
        return "id";
    }

    @GetMapping("/get")
    public Book getBook(){
        System.out.print("getById running...");
        Book book = new Book();
        book.setId(1);
        book.setName("少室山");
        book.setDescription("sss");
        book.setType("sss1");
        return book;
    }

}
